<template>
  <div class="system-user-dialog-container">
    <el-dialog
      :title="state.dialog.title"
      v-model="state.dialog.isShowDialog"
      width="900px"
    >
      <el-form
        ref="docDialogFormRef"
        :model="state.ruleForm"
        size="default"
        label-width="90px"
      >
        <el-row :gutter="35">
          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="文档名称">
              <el-input v-model="state.ruleForm.name" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="知识库">
              <el-input v-model="state.ruleForm.kname" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="文档类型">
              <el-input v-model="state.ruleForm.doc_type" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="文件原始名">
              <el-input v-model="state.ruleForm.src_name" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="token数">
              <el-input v-model="state.ruleForm.tokens" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="创建时间">
              <el-input v-model="state.ruleForm.create_time" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="创建人">
              <el-input v-model="state.ruleForm.create_admin" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="更新时间">
              <el-input v-model="state.ruleForm.update_time" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="源文件路径">
              <el-input v-model="state.ruleForm.src_url" readonly clearable></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="清洗路径">
              <el-input v-model="state.ruleForm.clean_url" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="清洗后缀">
              <el-input v-model="state.ruleForm.clean_type" readonly></el-input>
            </el-form-item>
          </el-col>

          <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
            <el-form-item label="清洗文件名">
              <el-input v-model="state.ruleForm.clean_name" readonly></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="35">
          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
            <el-form-item label="多媒体文件">
              <el-input v-model="state.ruleForm.mul_files" readonly clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="35">
          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
            <el-form-item label="多媒体路径">
              <el-input v-model="state.ruleForm.mul_paths" readonly clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>

      <template #footer>
        <span class="dialog-footer">
          <el-button @click="onCancel" size="default">取 消</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { reactive, ref, nextTick } from "vue";
import { DocumentOut, ComDatasOut } from "/@/api-services/models";

const docDialogFormRef = ref();
const state = reactive({
  ruleForm: {} as DocumentOut,
  dialog: {
    isShowDialog: false,
    type: "",
    title: "",
    submitTxt: "",
  },
});

const openDialog = (row: DocumentOut) => {
  state.ruleForm = row;
  state.dialog.title = "文档信息";
  state.dialog.submitTxt = "查 看";
  state.dialog.isShowDialog = true;
};
// 关闭弹窗
const closeDialog = () => {
  state.dialog.isShowDialog = false;
};
// 取消
const onCancel = () => {
  closeDialog();
};

// 暴露变量
defineExpose({
  openDialog,
});
</script>
<style scoped lang="scss"></style>
